﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Runtime.Serialization;

namespace DnnDash.SimplePhoneApp.Model
{
    [DataContract]
    [KnownType(typeof(DialogService))]
    [KnownType(typeof(DialogResult))]
    [KnownType(typeof(DialogButton))]
    [KnownType(typeof(IDialogService))]
    internal class DialogService : IDialogService
    {
        #region IDialogService Implementation for Windows Messagebox

        public DialogResult Show(string messageText)
        {
            MessageBox.Show(messageText);
            return DialogResult.OK;
        }
        public DialogResult Show(string messageText, string caption, DialogButton button)
        {
            return this.MessageBoxToDialogResult(MessageBox.Show(messageText, caption, this.DialogToMessageBoxButton(button)));
        }
        private DialogResult MessageBoxToDialogResult(MessageBoxResult messageBoxResult)
        {
            return (DialogResult)messageBoxResult;
        }
        private MessageBoxButton DialogToMessageBoxButton(DialogButton dialogButton)
        {
            return (MessageBoxButton)dialogButton;
        }

        #endregion
    }
}
